package br.com.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import br.com.example.Aggregator.AggregatorListener;

public class AndroidDojoActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        a = (Aggregator) findViewById(R.id.agg);
        a.setListener(new AggregatorListener() {
			
			@Override
			public void onButtonClicked(Button b, TextView t) {
				t.setText(b.getText());
			}
		});
        
        a.addButton(R.string.marmota, new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Toast.makeText(getApplicationContext(), "clicado", Toast.LENGTH_SHORT).show();
			}
		});
        
        a.addButton(R.string.app_name, new OnClickListener() {
        	
			@Override
			public void onClick(View arg0) {
				Toast.makeText(getApplicationContext(), "clicado", Toast.LENGTH_SHORT).show();
			}
		});
        
        a.addButton(R.string.hello, new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Toast.makeText(getApplicationContext(), "clicado", Toast.LENGTH_SHORT).show();
			}
		});
        
        a.addButton(R.string.marmota, new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Toast.makeText(getApplicationContext(), "clicado", Toast.LENGTH_SHORT).show();
			}
		});
        
        
    }
    
    
    private Aggregator a;
}